package spring.boot.adminx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import spring.boot.adminx.service.WxMiniAppService;

@Controller
@RequestMapping("/wx/mini/admin/app")
public class WxMiniAppController {

    @Autowired
    private WxMiniAppService wxMiniAppService;


    @GetMapping("list")
    @PreAuthorize("hasRole('WX_MINI_ADMIN_APP_LIST')")
    public String selectList(Model model){
        model.addAttribute("apps",wxMiniAppService.list());
        return "wx_mini_app/list";
    }

}
